package com.psp.web.model;

import java.util.ArrayList;
import java.util.List;
public class ServiceMenuTree {
	private String name;
	private String code;
	private ArrayList<ServiceMenuTree> children = new ArrayList<ServiceMenuTree>();
	
	public ServiceMenuTree(String name, String code) {
		this.name = name;
		this.code = code;
	}
	
	public ServiceMenuTree(String name, int code, List<ProductBean> lists) {
		this.name = name;
		this.code = code+"";
		if(lists.size() > 0) {
			ArrayList<ServiceMenuTree> ptrees = new ArrayList<ServiceMenuTree>();
			for(ProductBean p : lists) {
				ServiceMenuTree pt = new ServiceMenuTree(p.getTitle(), p.getPid());
				ptrees.add(pt);
			}
			this.children = ptrees;
		}
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public ArrayList<ServiceMenuTree> getChildren() {
		return children;
	}

	public void setChildren(ArrayList<ServiceMenuTree> children) {
		this.children = children;
	}

}